home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
cuj9205.zip
/
1005094A
< prev
next >
Wrap
Text File
|
1992-06-02
|
311b
|
22 lines
Listing 6
class rational
{
public:
rational() : num(0), denom(1) { }
...
friend ostream &operator<<(ostream &, rational)
private:
long num, denom;
void simplify();
};
...
ostream &operator<<(ostream &os, rational r)
{
os << '(' << r.num << '/' << r.denom << ')';
}